package druid;

import com.alibaba.druid.pool.DruidDataSourceFactory;

import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;

/**
 * @author zt
 * @date 2019-12-22 11:35
 */
public class Demo {
    public static void main(String[] args) throws Exception {
        Properties prop = new Properties();
        InputStream is = Demo.class.getClassLoader().getResourceAsStream("druid.properties");
        prop.load(is);
        DataSource ds = DruidDataSourceFactory.createDataSource(prop);
        Connection conn = ds.getConnection();
    }
}
